<?php
    session_start();
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
    <head>
        <LINK REL=StyleSheet HREF="maintenancePagesCSS.css" TYPE="text/css" />
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title></title>
    </head>
    <body>
<center>
        <h3><img src="images/TitleProductDelete.gif" alt="Delete Product" width="514" height="67"></h3>

        <?php
        if($_GET['id'])
        {
            $pk = $_GET['id'];
            include "ProductDetailsDao.php";
            include "Datasource.php";
            include "ProductDetails.php";
            $objProductDAO = new ProductDetailsDao();
            $objDatasource = new Datasource("localhost", "theanykey", "root", "");
            $objProduct = new ProductDetails();
           $objProduct = $objProductDAO->getObject(&$objDatasource, $pk);
           $Manufact = $objProduct->getManufacturer();
           $model = $objProduct->getModelNo();
           $serial = $objProduct->getSerialNo();
           $TechN = $objProduct->getTechNotes();

        ?>
        <form id="frmDeleteProduct" action="DeleteProductFunc.php" method="post">
        <table class="SelectTable">
            <tr>
                <th class="headerCell">
                    Manufacturer:
                </th>
                <td class="InfoRow" align="center">
                    <?php print($Manufact);?>
                    <input type="hidden" id="Manufacturer" name="Manufacturer" value="<?php print($Manufact) ?>" />
              </td>
            </tr>
            <tr>
                <th>
                    Model #:
                </th>
                <td class="InfoRow" align="center">
                    <?php print($model);?>
                    <input type="hidden" id="Model" name="Model" value="<?php print($model);?>" />
                </td>
            </tr>
            <tr>
                <th>
                    Serial #:
                </th>
                <td class="InfoRow" align="center">
                    <?php print($serial);?>
                    <input type="hidden" id="Serial" name="Serial" value="<?php print($serial);?>" />
                </td>
            </tr>
            <tr>
                <th>
                    Tech Notes:
                </th>
                <td class="InfoRow" align="center">
                    <?php print($TechN);?>
                    <input type="hidden" id="TechN" name="TechN" value="<?php print($TechN);?>" />
                </td>
            </tr>
        </table>
        <br />
        <input type="hidden" value="<?php print $pk; ?>" name="PK" id="PK"/>
        <input type="Submit" value="Submit" />
        </form>
    </center>
        <?php
        }
        else
        {
            print("<span style='color: Red'>There was an error accessing the information..."
            . "<br/>Please go back and try again.<br><i>If the problem persists, contact your system administrator...</i></span>");
        }
        ?>
        <br/>
        <center>
        <script src="links.js" language="javascript" type="text/javascript"></script>
        <script type="text/javascript">
            writeProductLinks("", "");
        </script>
        </center>
    </body>
</html>

